import request from '@/utils/request'

// 创建下载记录
export function createDownloadRecord(data) {
  return request({
    url: '/system/download-record/create',
    method: 'post',
    data: data
  })
}

// 更新下载记录
export function updateDownloadRecord(data) {
  return request({
    url: '/system/download-record/update',
    method: 'put',
    data: data
  })
}

// 删除下载记录
export function deleteDownloadRecord(id) {
  return request({
    url: '/system/download-record/delete?id=' + id,
    method: 'delete'
  })
}

// 获得下载记录
export function getDownloadRecord(id) {
  return request({
    url: '/system/download-record/get?id=' + id,
    method: 'get'
  })
}

// 获得下载记录分页
export function getDownloadRecordPage(params) {
  return request({
    url: '/system/download-record/page',
    method: 'get',
    params
  })
}

// 导出下载记录 Excel
export function exportDownload(id) {
  return request({
    url: '/system/download-record/download/' + id,
    method: 'get',
    responseType: 'blob'
  })
}
